package org.example.imageservice.Command;


import org.example.imageservice.service.BgimageService;
import org.springframework.http.ResponseEntity;

import java.io.IOException;

public class DeleteImageCommand extends Command {
    private final BgimageService bgimageService;
    private final String imageUrl;
    ResponseEntity response;

    public ResponseEntity getResponse() {
        return response;
    }

    public DeleteImageCommand(BgimageService bgimageService, String imageUrl) {
        this.bgimageService = bgimageService;
        this.imageUrl = imageUrl;
    }

    @Override
    public void execute() throws IOException {
       response=bgimageService.deleteImage(imageUrl);
    }
}
